<?php if(isset($message) && $message != "") { ?>
<script type="text/javascript">
    $(document).ready(function(){
        $('p.message').append("<?php echo $message; ?>");
    });
</script>
<?php } ?>